package cn.iocoder.yudao.module.water.dal.mysql.year;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.water.dal.dataobject.month.ReportMonthDO;
import cn.iocoder.yudao.module.water.dal.dataobject.year.ReportYearDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.water.controller.admin.year.vo.*;

/**
 * 年报 Mapper
 *
 * @author 左达成
 */
@Mapper
public interface ReportYearMapper extends BaseMapperX<ReportYearDO> {

    default PageResult<ReportYearDO> selectPage(ReportYearPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ReportYearDO>()
                .betweenIfPresent(ReportYearDO::getRtime, reqVO.getRtime())
                .orderByDesc(ReportYearDO::getId));
    }

    default List<ReportYearDO> selectList(ReportYearExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<ReportYearDO>()
                .betweenIfPresent(ReportYearDO::getRtime, reqVO.getRtime())
                .orderByDesc(ReportYearDO::getId));
    }

    default List<ReportYearDO> selectOneYearList(String st, String end) {
        return selectList(new LambdaQueryWrapperX<ReportYearDO>()
                .between(ReportYearDO::getRtime, st, end));
    }

}
